#ifndef _COMPAT_ATOMIC_H_
#define _COMPAT_ATOMIC_H_

#ifdef __cplusplus
extern "C"
{
#endif


#include <compat/define.h>

typedef struct os_atomic_s os_atomic_t;

struct os_atomic_s {
	void*		value;
};


void atomic_set(os_atomic_t *self, void *value);
void *atomic_cas(os_atomic_t *self, void *cmp, void *value);
void *atomic_xchg(os_atomic_t *self, void *value);
void atomic_int64_set(os_atomic_t *self, long long n);
long long atomic_int64_fetch_add(os_atomic_t *self, long long n);
long long atomic_int64_add_fetch(os_atomic_t *self, long long n);
long long atomic_int64_cas(os_atomic_t *self, long long cmp, long long n);



#ifdef __cplusplus
}
#endif

#endif
